package com.apes.auto.maintain.service;

import com.apes.auto.maintain.model.LevelOil;
import com.apes.auto.maintain.repository.LevelOilRepository;
import com.apes.framework.api.DomainService;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName LevelOilservice
 * @Description TODO
 * @Author pengyb
 * @Date 2019/8/9 16:41
 * @Version 1.0
 **/
@Service("levelOilservice")
public class LevelOilservice extends DomainService {
    @Autowired
    private LevelOilRepository levelOilRepository;

    public LevelOil save(SimpleRequest request) {
        LevelOil o = request.getO(LevelOil.class);
        LevelOil levelOil = levelOilRepository.saveAndFlush(o);
        return levelOil;
    }

    public String delete(SimpleRequest request) {
        LevelOil o = request.getO(LevelOil.class);
        levelOilRepository.delete(o);
        return "删除成功";
    }
}
